Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[debian/rules] fail on script error during package build #1050

Merged
merged 3 commits into from
Jun 14, 2022

Conversation

stepanblyschak
Copy link
Contributor

On bullseye, the following build command does not fail when configure
step is failing:

stepanb@3012cc6b379a:/sonic/src/sonic-sairedis$ fakeroot debian/rules binary-syncd
...
configure: exit 1
dh_auto_configure: error: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1
make[2]: *** [debian/rules:76: override_dh_auto_configure] Error 25
make[2]: Leaving directory '/sonic/src/sonic-sairedis'
+ dh binary -N syncd-rpc -N syncd-rpc-dbg -N syncd-vs -N syncd-vs-dbg --with autotools-dev
dh: warning: The autotools-dev sequence is deprecated and replaced by dh in debhelper (>= 9.20160115)
dh: warning: This feature will be removed in compat 12.
   debian/rules build
make[2]: Entering directory '/sonic/src/sonic-sairedis'
echo build stage is skipped. Please use binary to generate debian packages
+ DEB_BUILD_OPTIONS='nocheck parallel=12'
...
dpkg-deb: building package 'libsairedis-dbg' in '../libsairedis-dbg_1.0.0_amd64.deb'.
dpkg-deb: building package 'libsaivs-dbg' in '../libsaivs-dbg_1.0.0_amd64.deb'.
dpkg-deb: building package 'libsaimetadata-dbg' in '../libsaimetadata-dbg_1.0.0_amd64.deb'.
dpkg-deb: building package 'python-pysairedis' in '../python-pysairedis_1.0.0_amd64.deb'.
dpkg-deb: building package 'python3-pysairedis' in '../python3-pysairedis_1.0.0_amd64.deb'.
stepanb@3012cc6b379a:/sonic/src/sonic-sairedis$ echo $?
0

On previous buster, however, this command fails as expected:

stepanb@99083f3297fd:/sonic/src/sonic-sairedis$ fakeroot debian/rules binary-syncd
...
checking whether CXX supports -Wno-cast-function-type... yes
checking SAI headers API version and library version check... failed
configure: error: "SAI headers API version and library version mismatch"
make[1]: *** [Makefile:404: config.status] Error 1
make[1]: Leaving directory '/sonic/src/sonic-sairedis'
dh_auto_install: error: make -j1 install DESTDIR=/sonic/src/sonic-sairedis/debian/tmp AM_UPDATE_INFO_DIR=no returned exit code 2
make: *** [debian/rules:47: binary-syncd] Error 2
stepanb@99083f3297fd:/sonic/src/sonic-sairedis$ echo $?
2

It is required to have -e in .SHELLFLAGS to fail on such errors.

Also, fixed install pathes for python bindings and disabled python2 bindings when DEB_BUILD_PROFILES=nopython2 is passed.

Signed-off-by: Stepan Blyschak stepanb@nvidia.com

On bullseye, the following build command does not fail when configure
step is failing:

```
stepanb@3012cc6b379a:/sonic/src/sonic-sairedis$ fakeroot debian/rules binary-syncd
...
configure: exit 1
dh_auto_configure: error: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1
make[2]: *** [debian/rules:76: override_dh_auto_configure] Error 25
make[2]: Leaving directory '/sonic/src/sonic-sairedis'
+ dh binary -N syncd-rpc -N syncd-rpc-dbg -N syncd-vs -N syncd-vs-dbg --with autotools-dev
dh: warning: The autotools-dev sequence is deprecated and replaced by dh in debhelper (>= 9.20160115)
dh: warning: This feature will be removed in compat 12.
   debian/rules build
make[2]: Entering directory '/sonic/src/sonic-sairedis'
echo build stage is skipped. Please use binary to generate debian packages
+ DEB_BUILD_OPTIONS='nocheck parallel=12'
...
dpkg-deb: building package 'libsairedis-dbg' in '../libsairedis-dbg_1.0.0_amd64.deb'.
dpkg-deb: building package 'libsaivs-dbg' in '../libsaivs-dbg_1.0.0_amd64.deb'.
dpkg-deb: building package 'libsaimetadata-dbg' in '../libsaimetadata-dbg_1.0.0_amd64.deb'.
dpkg-deb: building package 'python-pysairedis' in '../python-pysairedis_1.0.0_amd64.deb'.
dpkg-deb: building package 'python3-pysairedis' in '../python3-pysairedis_1.0.0_amd64.deb'.
stepanb@3012cc6b379a:/sonic/src/sonic-sairedis$ echo $?
0
```

On previous buster, however, this command fails as expected:

```
stepanb@99083f3297fd:/sonic/src/sonic-sairedis$ fakeroot debian/rules binary-syncd
...
checking whether CXX supports -Wno-cast-function-type... yes
checking SAI headers API version and library version check... failed
configure: error: "SAI headers API version and library version mismatch"
make[1]: *** [Makefile:404: config.status] Error 1
make[1]: Leaving directory '/sonic/src/sonic-sairedis'
dh_auto_install: error: make -j1 install DESTDIR=/sonic/src/sonic-sairedis/debian/tmp AM_UPDATE_INFO_DIR=no returned exit code 2
make: *** [debian/rules:47: binary-syncd] Error 2
stepanb@99083f3297fd:/sonic/src/sonic-sairedis$ echo $?
```

It is required to have -e in .SHELLFLAGS to fail on such errors.

This change also fixes pysairedis install files.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
@stepanblyschak
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jun 4, 2022
…llseye (#10950)

To not try to build python2 bindings for sairedis for bullseye. The same solution was done for swss-common package.
Releated changes sonic-net/sonic-sairedis#1050

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
@stepanblyschak
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Collaborator

@kcudnik could you please help to merge?

@kcudnik kcudnik merged commit b13d7d2 into sonic-net:master Jun 14, 2022
lguohan pushed a commit that referenced this pull request Jun 16, 2022
In azp run, the following failure always happens at the stage of `make check` of building syncd. 

```
Making check in syncd
make[2]: Entering directory '/__w/1/s/syncd'
make check-TESTS
make[3]: Entering directory '/__w/1/s/syncd'
tests: tests.cpp:843: void test_watchdog_timer_clock_rollback(): Assertion `settimeofday(&currentTime, NULL) == 0' failed.
/bin/bash: line 5: 13004 Aborted (core dumped) ${dir}$tst
FAIL: tests
```
The execution of `settimeofday(&currentTime, NULL)` fails in slave docker with errno **EPERM**, because CAP_SYS_TIME capability is dropped in docker. Using option `--privileged` gives docker extended privileges for its success.

This failure has existed for a long time in azp build and is not exposed till #1050.
stepanblyschak added a commit to stepanblyschak/sonic-buildimage that referenced this pull request Jul 1, 2022
…llseye (sonic-net#10950)

To not try to build python2 bindings for sairedis for bullseye. The same solution was done for swss-common package.
Releated changes sonic-net/sonic-sairedis#1050

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
)

It is required to have -e in .SHELLFLAGS to fail on such errors.

Also, fixed install pathes for python bindings and disabled python2 bindings when DEB_BUILD_PROFILES=nopython2 is passed.

Signed-off-by: Stepan Blyschak [stepanb@nvidia.com](mailto:stepanb@nvidia.com)
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
In azp run, the following failure always happens at the stage of `make check` of building syncd. 

```
Making check in syncd
make[2]: Entering directory '/__w/1/s/syncd'
make check-TESTS
make[3]: Entering directory '/__w/1/s/syncd'
tests: tests.cpp:843: void test_watchdog_timer_clock_rollback(): Assertion `settimeofday(&currentTime, NULL) == 0' failed.
/bin/bash: line 5: 13004 Aborted (core dumped) ${dir}$tst
FAIL: tests
```
The execution of `settimeofday(&currentTime, NULL)` fails in slave docker with errno **EPERM**, because CAP_SYS_TIME capability is dropped in docker. Using option `--privileged` gives docker extended privileges for its success.

This failure has existed for a long time in azp build and is not exposed till sonic-net#1050.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants